<?php /*a:2:{s:72:"/www/wwwroot/pay.rym.best/application/admin/view/order/delorderlist.html";i:1563242528;s:65:"/www/wwwroot/pay.rym.best/application/admin/view/common/head.html";i:1563242522;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title><?php echo config('sys_name'); ?>后台管理</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="shortcut icon" href="/favicon.ico"/>  
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/static/admin/css/global.css" media="all">
    <link rel="stylesheet" href="/static/common/css/font.css" media="all">
</head>
<body class="skin-<?php if(!empty($_COOKIE['skin'])){echo $_COOKIE['skin'];}else{echo '0';setcookie('skin','0');}?>"> 
    <div class="admin-main">
        <fieldset class="layui-elem-field layui-field-title"><legend>全部订单<?php echo lang('list'); ?></legend></fieldset>
        <div class="demoTable layui-form"> 
            <div class="layui-inline">
                <select id="shopid" name="shopid" ng-model="field.shopid" lay-filter="shopid" lay-verify="required">
                    <option value="">请选择所属商户</option>
                    <?php if(is_array($shoplist) || $shoplist instanceof \think\Collection || $shoplist instanceof \think\Paginator): $i = 0; $__LIST__ = $shoplist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><option value="<?php echo htmlentities($vo['id']); ?>"><?php echo htmlentities($vo['name']); ?></option>  <?php endforeach; endif; else: echo "" ;endif; ?>
                </select> 
            </div> 
            <div class="layui-inline">
                <select id="state" name="state"  ng-model="field.state" lay-filter="state" lay-verify="required">
                    <option value="">按支付状态</option>
                    <option value="-1">待支付</option>
                    <option value="2">已确认</option>
                </select>
            </div>
            <div class="layui-inline"> 
                <input type="text" id="timess" name="timess" class="layui-input"placeholder="选择日期"> 
            </div>
            <div class="layui-inline">
                <input id="orderid" class="layui-input" name="orderid"  placeholder="平台订单号">
            </div>
            <div class="layui-inline">
                <input id="orderid_out" class="layui-input" name="orderid_out"  placeholder="商户订单号">
            </div>
            <button class="layui-btn layui-btn-primary" id="search">搜索</button>  
            <button class="layui-btn layui-btn-primary" id="del">删除</button> 
           <!--  <input class="layui-btn layui-btn-primary"  type="submit" value="删除" onclick="return window.confirm('删除后不可恢复！');"> -->
        </div>
        <table class="layui-table layui-hide" id="orderlist" lay-filter="listss"></table>
    </div> 
<script type="text/html" id="payinfo"> 
    {{# if(d.bankid){ }}<div onmouseover="layer.tips('{{d.bank_name}}<br>收款账号：{{d.bank_no}}<br>支付时间：{{d.paytime}}',this,{area: 'auto',tips: [1, '#333']});" onmouseout="layer.closeAll();">{{d.payname}}</div>{{# } }} 
</script>
<script src="/static/plugins/layui/layui.js"></script> 
<script>
   
    layui.use(['layer','table','form','laydate'], function() {
        var table = layui.table,form = layui.form, $ = layui.jquery, layer = layui.layer,laydate = layui.laydate;;
        laydate.render({
            elem: '#timess',range: true,type: 'datetime'
        });

         tableIn = table.render({
            id: 'listss',
            elem: '#orderlist',
            toolbar: '#topNav',
            url: '<?php echo url("delorderlist"); ?>',
            method: 'post', 
            page: true,
            cols: [[ 
                {field: 'orderid', title: '平台订单号',align: 'center', width:138, fixed: true},
                {field: 'orderid_out', title: '商户订单号',align: 'center', width:138, fixed: true},
                {field: 'cionname', title: '币种名称',align: 'center', width: 120, fixed: true},
                {field: 'money', title: '订单金额',align: 'center', width: 120, fixed: true}, 
                // {field: 'price', title: '单价/CNY',align: 'center', width: 100},
                // {field: 'number', title: '数量',align: 'center', width: 100},
                {field: 'state_name', title: '订单状态',align: 'center', width: 90}, 
                // {field: 'points_name', title: '上分状态',align: 'center', width: 90}, 
                {field: 'payname', title: '支付信息',align: 'center', width: 100,templet: '#payinfo'}, 
                // {field: 'fei_shop', title: '商户手续费',align: 'center', width: 100}, 
                // {field: 'fei_user', title: '码商手续费',align: 'center', width: 100},   
                // {field: 'fei_agent', title: '代理手续费',align: 'center', width: 100},  
                {field: 'channelname', title: '所属通道',align: 'center', width: 120}, 
                {field: 'username', title: '所属码商',align: 'center', width: 100},  
                {field: 'shopname', title: '所属商户',align: 'center', width: 120,templet: '#shopinfo'}, 
                // {field: 'note', title: '备注信息',align: 'center', width: 120},  
                {field: 'addtime', title: '提交时间',align: 'center', width: 169},   
            ]],
            limit: 60 //每页默认显示的数量
        });  
        //搜索
        $('#search').on('click', function() {
            var shopid = $('#shopid').val();
            var channelid = $('#channelid').val();
            var timess = $('#timess').val();
            var state = $('#state').val();
            var points = $('#points').val();
            var orderid = $('#orderid').val();
            var orderid_out = $('#orderid_out').val();
            var paytype = $('#paytype').val();
            if($.trim(shopid)==='' && $.trim(channelid)==='' && $.trim(timess)==='' && $.trim(orderid)==='' && $.trim(orderid_out)==='' && $.trim(state)==='' && $.trim(points)==='' && $.trim(paytype)==='') {
                layer.msg('请输入平台订单号！',{icon:0});
                return;
            }else{
                tableIn.reload({ page: {page: 1},where: {shopid: shopid,channelid: channelid,timess: timess,orderid: orderid,orderid_out: orderid_out,state: state,points: points,paytype: paytype}});
            } 
        });
        //删除
         $('#del').on('click', function() {
            if(confirm("确定删除吗?")){
        // 　　     return true; 
            }else{
                return false;
            }
            var shopid = $('#shopid').val();
            var channelid = $('#channelid').val();
            var timess = $('#timess').val();
            var state = $('#state').val();
            var points = $('#points').val();
            var orderid = $('#orderid').val();
            var orderid_out = $('#orderid_out').val();
            var paytype = $('#paytype').val();
            if($.trim(shopid)==='' && $.trim(channelid)==='' && $.trim(timess)==='' && $.trim(orderid)==='' && $.trim(orderid_out)==='' && $.trim(state)==='' && $.trim(points)==='' && $.trim(paytype)==='') {
                layer.msg('请输入平台订单号！',{icon:0});
                return;
            }else{
                 $.ajax({
                    url:'<?php echo url("del"); ?>',
                    data:{'shopid':shopid,'timess':timess,'state':state,'orderid':orderid,'orderid_out':orderid_out},
                    type:"Post",
                    dataType:"json",
                    success:function(data){
                        if(data.code == '1'){
                            layer.msg(data.msg);
                            location.reload();
                        }else{
                           layer.msg(data.msg); 
                        }
                        
                        
                    },
                    error:function(data){
                        $.messager.alert('错误',data.msg);
                    }
                });
            } 
        });
        // form.on('select(shopid)', function (data) {
        //     var shopid = data.value;
        //     $.get("<?php echo url('channel/getChannel'); ?>?shopid=" + shopid, function (data) {
        //         var html = '<option value="">请选择通道</option>';
        //         $.each(data, function (i, value) {
        //             html += '<option value="' + value.id + '">' + value.title + '</option>';
        //         });
        //         $('#channelid').html(html); 
        //         form.render()
        //     });
        // });     
    });
    function orderquan(timessss){
        tableIn.reload({ page: {page: 1},where: {timequan:timessss}}); 
    }

    // $(function(){
    //     $("#btn").click(function(){
    //         return confirm("是否确认删除");
    //     });
    // });
    function no_del()
    {
        if(confirm("确定删除吗?")){
    　　     return true; 
        }else{
            return false;
        }

    }
</script>
</body>
</html>